<?php
require 'tail.php';
assert_options(ASSERT_BAIL,true);
$normal_result=file_get_contents('tests/tail_files/normal_result');
$all_result=file_get_contents('tests/tail_files/normal');

echo 'testing 20 lines & 1/chunk ... ';
$result=tail('tests/tail_files/normal',20,1);
assert($result==$normal_result);
echo "ok\n";

echo 'testing 20 lines & 21/chunk ... ';
$result=tail('tests/tail_files/normal',20,21);
assert($result==$normal_result);
echo "ok\n";

echo 'testing 20 lines & 210000/chunk ... ';
$result=tail('tests/tail_files/normal',20,210000);
assert($result==$normal_result);
echo "ok\n";

echo 'testing all lines & 1/chunk ... ';
$result=tail('tests/tail_files/normal',200,1);
assert($result==$all_result);
echo "ok\n";

echo 'testing all lines & 210000/chunk ... ';
$result=tail('tests/tail_files/normal',200,210000);
assert($result==$all_result);
echo "ok\n";
